package org.bluedream.core.module.dao.bill;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.bluedream.core.module.entity.bill.OrdHead;

/**
 * @ClassName OrdHeadDao
 * @Description TODO
 * @Author foxsand
 * @Data 9:10
 * @Version
 */
public interface OrdHeadDao extends BaseMapper<OrdHead> {

    @Override
    @Select("select a.bill_type as billType , a.bill_num as billNum , a.check_date as checkDate , a.check_by as checkBy , " +
            "a.war_code as warCode , c.name as warName , " +
            "a.supplier_code as supplierCode , b.name as supplierName , a.qty as qty , a.total as total , " +
            " a.id as id , a.create_by as createBy , a.create_date as createDate , a.update_by as updateBy , a.update_date as updateDate , a.status as status , a.remarks as remarks" +
            " from ord_head a, tSupplier b , warehouse c " +
            "${ew.customSqlSegment} and a.supplier_code = b.code and a.war_code = c.code")
    IPage<OrdHead> selectPage(IPage<OrdHead> page, @Param("ew")Wrapper<OrdHead> queryWrapper);
}
